use axum::extract::State;
use axum::Router;
use axum::routing::{get, post};

use crate::handlers::delete_file::delete_file;
use crate::handlers::download_file::download_file;
use crate::handlers::index::index;
use crate::handlers::upload_file::upload_file;
use crate::models::AppState::AppState;
use crate::handlers::dictionnary_file::dictionnary_file;
pub async fn get_routes() -> axum::Router {
    let app_state = AppState::new().await;
    axum::Router::new()
        .route("/", get(dictionnary_file))
        .route("/upload", post(upload_file))
        .route("/download", get(download_file))
        .route("/delete", get(delete_file))
        .with_state(app_state)
}